<style>
    body {
        background: #f5f5f5;
    }
    .noAddress{width:100%;display: block;padding: 5vw 0;}
    .noAddress img{display: block;width:13%;margin: 0 auto;}
    .noAddress p{text-align: center;font-size: 0.85rem;color: #606060;}
</style>
<div class="sectionY">
    <a href="javascript:history.back()">
        <img src="__PUBLIC__/home/images/a4.png" class="a1" alt="">
    </a>
    <p class="p1">确认订单</p>
</div>
<div class="kong1"></div>
<div class="ch_section2" {if $info['address']['has_address']!=1}style="display:none;"{/if}>
    <div class="ch_section2_1 clearfix">
        <a href="{:url('User/address')}?redirect_url=1">
            <div class="ax">
                <img src="__PUBLIC__/home/images/a54.png" alt="">
            </div>
            <div class="center">
                <p class="p1">
                    <span class="s1">{$info['address']['name']}</span>
                    <span class="s2">{$info['address']['mobile']|show_star}</span>
                </p>
                <p class="p2">
                    <span class="s1" {if $info['address']['is_def']!=1}style="display:none;"{/if}>默认</span>
                    <span class="s2">{$info['address']['pca']} {$info['address']['detail']}</span>
                </p>
            </div>
            <div class="right">
                <img src="__PUBLIC__/home/images/a39.png" alt="">
            </div>
        </a>
    </div>
</div>
<input type="hidden" name="address_id" value="{$info['address']['address_id']}">
<a class="noAddress" href="{:url('User/addAddress')}?redirect_url=2" {if $info['address']['has_address']==1}style="display:none;"{/if}>
<img src="__PUBLIC__/home/images/a41.png"/>
<p>添加收货地址</p>
</a>
<div class="ch_section3">
    {foreach $info['goods'] as $item}
    <div class="ch_section3_1">
        <div class="wr clearfix">
            <div class="left">
                <img src="{$item.img_url}" alt="">
            </div>
            <div class="right">
                <p class="p1 chao2">{$item.title} {$item['spec_title']}</p>
                <p class="p2">{$item.price} <span style="color: #000">X{$item.num}</span> </p>
            </div>
        </div>
<!--        <div class="we clearfix">-->
<!--            <p class="p1">购买数量</p>-->
<!--            <p class="p2">-->
<!--                <img src="images/a56.png" class="im_pr" alt="">-->
<!--                <input type="number" value="{$item.num}" readonly>-->
<!--                <img src="images/a57.png" class="im_ad" alt="">-->
<!--            </p>-->
<!--        </div>-->
    </div>
    {/foreach}
</div>
<div class="qq_section1">
    <div class="qq_section1_1">
        <div class="f1 clearfix">
            <p class="p1">商品金额</p>
            <p class="p2">{$info.goods_price}</p>
        </div>
        <div class="f1 clearfix">
            <p class="p1">运费</p>
            <p class="p2">{$info.dispatch_price}</p>
        </div>
        <div class="f1 clearfix" style="border: none;">
            <p class="p1">应付总额</p>
            <p class="p2" style="color:#ff4546;">{$info.use_coin_price}</p>
        </div>
    </div>

</div>
<div class="kong"></div>
<div class="qt_section1 qt_section1x">
    <p class="p1">{$info.use_coin_price}</p>
    <a href="javascript:void(0);" id="subBtn" class="z2">提交订单</a>
</div>

<script type="text/javascript">
    $(function(){
        $("#subBtn").click(function () {
            var message = $("#message").val();
            modal.ajax("{:url('Order/subOrder')}",{message:message},function (res) {
                if(res.result_code==0){
                    var needPay = res.result_data.status;
                    var order_sn = res.result_data.order_sn;
                    if(needPay<=0){
                        //不需要支付 跳转支付成功
                        window.location.replace("{:url('Order/paySuccess')}");
                    }else{
                        var url = "{:url('Order/pay')}?orderSn="+order_sn;
                        window.location.replace(url);
                    }

                }else{
                    modal.msg(res.result_info);
                }
            })
        });
    })
</script>